﻿@using Library
@model Library.Models.SpecificationGroup
@{
    var modeCulture = Model.SpecificationGroupCultures.SingleOrDefault(pcc => pcc.Culture == NOWCulture.CurrentCulture) ?? Model.SpecificationGroupCultures.First();
}
<tr data-id="@Model.Id" class="warning">
    <th scope="row">@Html.DisplayFor(m => modeCulture.Name)</th>
    <td>@Html.DisplayFor(m => modeCulture.Description)</td>
    <td>
        <button type="button" class="btn btn-sm btn-success" data-editor="create-specification" data-id="-1" data-refid="@Model.Id"><span class="glyphicon glyphicon-plus"></span>@NOWCulture.GetString("Create a new specification")</button>
        <button type="button" class="btn btn-sm btn-primary" data-editor="edit" data-id="@Model.Id"><span class="glyphicon glyphicon-edit"></span>@NOWCulture.GetString("Edit")</button>
        <button type="button" class="btn btn-sm btn-danger" data-editor="remove" data-id="@Model.Id"><span class="glyphicon glyphicon-remove"></span>@NOWCulture.GetString("Remove")</button>
    </td>
</tr>
@if (ViewData["HideSpecifications"] == null && !Convert.ToBoolean(ViewData["HideSpecifications"]))
{
    var specifications = Model.Specifications.OrderBy(i => i.DisplayOrder);
    foreach (var specification in specifications)
    {
        @Html.Partial("_SpecificationRow", specification)
    }
}